//2009/09/09 11:21:10
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class DNASingleMatcher
{
public:
    int longestMatch(string s1, string s2)
    {
        int ret = 0;
        for (int i=0; i<s1.size(); i++)
        {
            string s;
            s.clear();
            for (int j=i; j<s1.size(); j++)
            {
                s += s1[j];
                if (s2.find(s) != string::npos)
                    ret = max(ret, (int)s.size());
            }
        }
        return ret;
    }
};
